import { BasicColumn, BasicTable, FormSchema, useRender, useTable } from "@/components/Table";
import { useTranslation } from "react-i18next";
import Toolbar from "@/components/ViewComponents/Toolbar";
import { depositHistoryPage } from "@/api/MedicalExamination/index";

const index = () => {
	const { t } = useTranslation();
	const searchFormSchema: FormSchema[] = [
		{
			label: t("felix_ui.patient_ID"),
			field: "patientId",
			component: "Input"
		},
		{
			label: t("felix_ui.full_name"),
			field: "fullName",
			component: "Input"
		},
		{
			label: t("felix_ui.admission_date"),
			field: "admissionDate",
			component: "DatePicker"
		},
		{
			label: t("kevin_ui.discharge_department"),
			field: "dischargeDept",
			component: "Input"
		},
		{
			label: t("felix_ui.address"),
			field: "address",
			component: "Input"
		},
		{
			label: t("felix_ui.birthday"),
			field: "birthday",
			component: "DatePicker"
		},
		{
			label: t("felix_ui.beneficiary"),
			field: "beneficiary",
			component: "Input"
		}
	];
	const columns: BasicColumn[] = [
		{
			title: t("felix_ui.secmt_date"),
			dataIndex: "createdTime",
			render: value => useRender.renderDate(value, "YYYY-MM-DD")
		},
		{
			title: t("felix_ui.amount"),
			dataIndex: "fee"
		},
		{
			title: t("kevin_ui.old_Patient_type"),
			dataIndex: "oldPatCardno"
		},
		{
			title: t("kevin_ui.new_patient_type"),
			dataIndex: "newPatCardno"
		},
		{
			title: t("felix_ui.department"),
			dataIndex: "deptId"
		}
	];
	// const getList = () => {
	// 	return [
	// 		{
	// 			fullName: "Felix",
	// 			secmtDate: "Renger",
	// 			amount: "2025-8-8",
	// 			oldPatientType: "adsffssdasdsa",
	// 			newPatientType: "5455456",
	// 			department: "dsagffs",
	// 			beneficiary: "dsagffs",
	// 			birthday: "2025",
	// 			address: "dsagffs",
	// 			dischargeDept: "dsagffs",
	// 			admissionDate: "dsagffs"
	// 		},
	// 	];
	// };
	const [registerTable] = useTable({
		// dataSource: getList(),
		api: depositHistoryPage,
		columns: columns,
		formConfig: {
			labelWidth: 120,
			schemas: searchFormSchema,
			showActionButtonGroup: true,
			showAdvancedButton: false,
			baseColProps: { span: 6 }
		},
		useSearchForm: true
		// rowSelection: { type: "checkbox" }
	});
	return (
		<div className="page">
			<div className="page-content block">
				<BasicTable register={registerTable}></BasicTable>
			</div>
			<Toolbar btnList={[{ key: "save", disabled: true }]} />
		</div>
	);
};
export default index;
